import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";

export default {

	//获取策略配置
	getStrategyList(params) {
		return request(`/new-common/smartStrategy/execute/config/get?${stringify(params)}`);
	},

	//保存策略配置
	updateStrategyList(params) {
		return request(`/new-common/smartStrategy/execute/config/addOrUpdate`, {
			method: 'post',
			data: params
		});
	},

	//智能策略手动执行
	executeStrategy(params) {
		return request(`/new-common/smartStrategy/manual/execute`, {
			method: 'post',
			data: params
		});
	},

	//获取智能策略执行记录
	getExecuteRecord(params) {
		return request(`/new-oms/smartExecute/query/log`, {
			method: 'post',
			data: params
		});
	},

	//获取快捷查询列表
    getQueryList(params) {
		return request(`/new-common/quickSearch/config/listByPages`, {
			method: 'post',
			data: params
		});
	},

	//获取异常原因-所有
	getErrorReasonAll() {
		return request(`/new-common/errorConfig/listAllError`);
	},

	//批量修改异常
	batchUpdatErrorList(params) {
		return request(`/new-common/errorConfig/batchUpdate`, {
			method: 'post',
			data: params
		});
	},

	//转正常订单预览
	normalOrder(params) {
		return request(`/new-oms/order/becomeNormal/batch`, {
			method: 'post',
			data: params
		});
	},

	//智能合单预览
	autoMergeOrderView() {
		return request(`/new-oms-search/esOrder/batchMergeNum`);
	},

	//拆分订单策略列表
	spitStrategyList() {
		return request(`/new-common/splitStrategy/list`);
	},

	//拆分订单策略详情
	spitStrategyDetail(params) {
		return request(`/new-common/splitStrategy/getById?${stringify(params)}`);
	},

	//新增策略
	addSpitStrategy(params) {
		return request(`/new-common/splitStrategy/save`, {
			method: 'post',
			data: params
		});
	},

	//编辑策略
	updateSpitStrategy(params) {
		return request(`/new-common/splitStrategy/update`, {
			method: 'post',
			data: params
		});
	},

	//删除策略
	delSpitStrategy(params) {
		return request(`/new-common/splitStrategy/delete?${stringify(params)}`, {
			method: 'post',
		});
	},

	//搜索供应商
	queryListByStoreName(params) {
		return request(`/blade-goods/zjfstore/listByStoreName?${stringify(params)}`);
	}

}
//审核订单
// export async function getInventorytransactionRecordslist(params) {
// 	return request(`/new-wms/inventorytransactionrecords/list?${stringify(params)}`);
// },
